<script>


</script>
<div id="pan">
	<?php echo $html->link(__('Home',true), '/'); ?> &gt; 
	<?php echo $html->link(__('Article',true), array('controller'=>'articles')); ?> &gt; 
	<strong><?php echo $article['Article']['title']; ?></strong>
	<ul class="navi">
		<?php if(!empty($neighbours['prev'])) echo '<li class="navi_left">' .$html->link(__('<< prev ',true), array('controller'=>'articles','action'=>'view', 'id'=>$neighbours['prev']['Article']['id']), array('id'=>'prev','rel'=>'prev')).'<span dojoType="dijit.Tooltip" connectId="prev">'.$neighbours['prev']['Article']['title'].'</span></li>'; ?>
		<?php if(!empty($neighbours['next'])) echo '<li class="navi_right"><span dojoType="dijit.Tooltip" connectId="next">'.$neighbours['next']['Article']['title'].'</span>'.$html->link(__(' next >>',true), array('controller'=>'articles','action'=>'view', 'id'=>$neighbours['next']['Article']['id']), array('id'=>'next','rel'=>'next')).'</li>'; ?>
		<li class="navi_note"><?php echo $html->link(__('Article',true), array('controller'=>'articles')); ?></li>
	</ul>
</div>

<h2 id="title"><?php echo $article['Article']['title']; ?></h2>
<div id="navigator" class="title_toolbar"></div>
<div id="media"></div>
<div class="info">
	<?php echo __('Rank',true); ?> : <?php echo $html->link($article['Rank']['name'], array('controller'=>'articles','action'=>'view', 'id'=>$neighbours['prev']['Article']['id']), array('id'=>'prev','rel'=>'prev')); ?> | 
	<?php echo __('Source',true); ?> : <?php echo $html->link($article['Article']['source'],'http://www.google.co.jp/custom?q='.rawurlencode($article['Article']['source']).'&amp;ie=UTF-8&amp;oe=UTF-8&amp;client=pub-3377384624413528&amp;cof=FORID:1%3BS:http://logue.be/%3BL:http://logue.sphere.sc/image/logo_small.png%3BLH:50%3BLW:50%3BLP:1%3B' ); ?></p>
</div>

<div id="post" class="post" rel="DC:description">
<?php echo $article['Article']['body']; ?>
</div>

<hr />
<div class="info">
	by <?php echo $html->link($article['User']['username'], array('action'=>'index',$article['User']['id'],'user')); ?> | 
	<?php echo __('Posted: '); ?><?php echo $article['Article']['created']; ?> / <?php echo __('Modified: '); ?><?php echo $article['Article']['modified']; ?> | 
	<?php echo $html->link($article['Category']['name'], array('action'=>'index',$article['Category']['id'],'category')); ?> | 
	<?php echo $html->link(__('Parmalink',true), array('controller'=>'articles','action'=>'view', 'id'=>$article['Article']['id']), array('id'=>'permalink')); ?> |
</div>
<!--iframe src="http://www.facebook.com/widgets/like.php?href=<?php echo rawurlencode('http://mabinogi.logue.be/articles/view/'.$article['Article']['id']); ?>" scrolling="no" frameborder="0"style="border:none; width:450px; height:80px"></iframe-->

<h3 id="mml"><?php echo __('MML'); ?></h3>
<div class="mmls">
	<div dojoType="dijit.layout.TabContainer" doLayout="false" id="mmls">
		<?php 
		if (!empty($article['Mml'])):
			$i=0;
			foreach ($article['Mml'] as $mml):
				$i++;
		?>
		<div dojoType="dijit.layout.ContentPane" title="<?php if ($mml['name']){ echo $mml['name']; }else{ echo 'Track '.$i; } ?>" id="Track<?php echo $i; ?>">
			<div dojoType="dijit.Toolbar">
				<button class="mml_btn" id="play_<?php echo $mml['id'];?>" dojoType="dijit.form.Button" iconclass="LoreleiIcon LoreleiIconMmlPlay"><?php echo __('Play this track', true); ?></button>
				<button class="mml_btn" id="copy_<?php echo $mml['id'];?>" dojoType="dijit.form.Button" iconclass="LoreleiIcon LoreleiIconMmlCopy"><?php echo __('Copy this track', true); ?></button>
<?php if(isset($auth) && $auth['User']['id'] == $mml['user_id']){ ?>
				&nbsp;
				<button class="mml_btn" id="edit_<?php echo $mml['id'];?>" dojoType="dijit.form.Button" iconclass="LoreleiIcon LoreleiIconMmlEdit"><?php echo __('Edit MML Track', true); ?></button>
				<button class="mml_btn" id="delete_<?php echo $mml['id'];?>" dojoType="dijit.form.Button" iconclass="LoreleiIcon LoreleiIconMmlDelete"><?php echo __('Delete this track', true); ?></button>
<?php } ?>
			</div>
			<dl>
				<dt><?php echo __('Instrument'); ?></dt>
				<dd><?php echo __($instrument[$mml['instrument_id']]); ?></dd>
				<dt><?php echo __('Rank'); ?></dt>
				<dd><?php echo $ranks[$mml['rank_id']]; ?></dd>
				<dt><?php echo __('Pan pod'); ?></dt>
				<dd>
					<div dojoType="dijit.form.HorizontalSlider"
						value="<?php echo $mml['pan']; ?>"
						maximum="127"
						minimum="0"
						intermediateChanges="false"
						style="width:80%;"
						disabled="true"
						showButtons="false"
					>
						<div dojoType="dijit.form.HorizontalRule" container="bottomDecoration" count="9" style="height:6px;"></div>
						<ol dojoType="dijit.form.HorizontalRuleLabels" container="bottomDecoration" style="height:12px;font-size:9px;color:gray;">
							<li><?php echo __('Left',false); ?></li>
							<li><?php echo __('Center',false); ?></li>
							<li><?php echo __('Right',false); ?></li>
						</ol>
					</div>
				</dd>
				<dt><?php echo __('MML'); ?></dt>
				<dd>
<pre class="mml">MML@
<?php echo h(chunk_split($mml['ch1'],75,"\n"));?>
,
<?php echo h(chunk_split($mml['ch2'],75,"\n"));?>
,
<?php echo h(chunk_split($mml['ch3'],75,"\n"));?>
;</pre>
				</dd>
			</dl>
		</div>
	<?php endforeach; 
	endif; ?>
	</div>
</div>

<?php if ($article['Article']['lyrics'] != ''): ?>
<h3><?php echo __('Lyrics',true); ?></h3>
<div class="post">
	<p><?php echo nl2br(str_replace("\r\n\r\n","</p><p>",$article['Article']['lyrics'])); ?></p>
</div>
<?php endif; ?>

<h3 id="comment"><?php echo __('Comments',true); ?></h3>
<div class="info"><?php echo $html->link(__('Comments',true), array('controller'=>'articles','action'=>'view', 'id'=>$article['Article']['id'], '#'=>'disqus_thread')); ?></div>
<div id="comments">
	<div id="disqus_thread">Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript=lorelei">comments powered by Disqus.</a></div>
	<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
</div>

<?php 
// Dojo読み出し
$head->jsblock('dojo.require("dojo.parser");	// scan page for widgets and instantiate them
dojo.require("dojo.html");
dojo.require("dijit.Menu");
dojo.require("dijit.Toolbar");
dojo.require("dijit.Tooltip");
dojo.require("dijit.form.Button");
dojo.require("dijit.form.CheckBox");
dojo.require("dijit.form.Form");
dojo.require("dijit.form.Slider");
dojo.require("dijit.form.TextBox");
dojo.require("dijit.form.Textarea");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.TabContainer");

//google.load("language", "1");
//dojo.require("lorelei.translate");
dojo.require("lorelei.articles");
dojo.require("lorelei.mml.markup");

var auth_id = "'.$auth['User']['id'].'";
var mml_tracks = "'.count($article['Mml']).'";
//lorelei.translate.lang = "'.Configure::read('Config.language').'";
var id = "'.$article['Article']['id'].'";
var user = "'.$article['Article']['user_id'].'";
var locale = {
	"play":"'.__('Play',true).'",
	"stop":"'.__('Stop',true).'",
	"export_file":"'.__('Export',true).'",
	"download":"'.__('Download %s Format',true).'",
	"manage": "'.__('Management',true).'",
	"edit":"'.__('Edit',true).'",
	"delete":"'.__('Delete',true).'",
	"add track":"'.__('Add MML Track',true).'",
	"play track":"'.__('Play this track',true).'",
	"copy track":"'.__('Copy this track',true).'",
	"edit track":"'.__('Edit this Track',true).'",
	"delete track":"'.__('Delete this track',true).'",
	"confirm": "'.__('Are you sure you want to delete?',true).'",
	"clipboard":"'.__('Copying to clipboard by Mabinogi MML format.',true).'\n'.__('Note: Clipboard will be overwritten.',true).'\n\n'.__('Please use with the common sense.',true).'",
	"copied":"'.__('Copied to clipboard.',true).'"
};

dojo.require("lorelei.articles.view");
');
// SEO
$head->meta(array('name'=>'author','content'=>$article['User']['username']));
$head->meta(array('name'=>'DC.title','content'=>$article['Article']['title']));
$head->meta(array('name'=>'DC.creator','content'=>$article['User']['username']));
$head->meta(array('name'=>'DC.date.created','content'=>$article['Article']['created']));
$head->meta(array('name'=>'DC.date.modified','content'=>$article['Article']['modified']));
$head->meta(array('name'=>'description','content'=>mb_strimwidth(ereg_replace("\r|\n","",strip_tags($article['Article']['body'])),0,155,'...','UTF-8')));
$head->meta(array('name'=>'keyword','content'=>'MML,Mabinogi,MIDI,JSMML,FLMML,'.$article['Article']['source']));	// タグ機能で呼び出したワードを入れる予定
$head->link(array('rel'=>'up','title'=>__('Article',true),'href'=>'../'));

if(!empty($neighbours['prev'])) $head->link(array('rel'=>'prev','title'=>$neighbours['prev']['Article']['title'],'href'=>'./'.$neighbours['prev']['Article']['id']));
if(!empty($neighbours['next'])) $head->link(array('rel'=>'next','title'=>$neighbours['next']['Article']['title'],'href'=>'./'.$neighbours['next']['Article']['id']));

echo $this->renderElement('HatenaStar');
?>
